﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptDoanhThuTheoMatHangChiTiet : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CmdChonHang")]
        private System.Windows.Forms.Button _CmdChonHang;
        [AccessedThroughProperty("CmdExcel")]
        private System.Windows.Forms.Button _CmdExcel;
        [AccessedThroughProperty("CmdPrint")]
        private System.Windows.Forms.Button _CmdPrint;
        [AccessedThroughProperty("CmdRefresh")]
        private System.Windows.Forms.Button _CmdRefresh;
        [AccessedThroughProperty("CmdThoat")]
        private System.Windows.Forms.Button _CmdThoat;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label13")]
        private System.Windows.Forms.Label _Label13;
        [AccessedThroughProperty("Label2")]
        private System.Windows.Forms.Label _Label2;
        [AccessedThroughProperty("Label23")]
        private System.Windows.Forms.Label _Label23;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtMatHang")]
        private System.Windows.Forms.TextBox _TxtMatHang;
        [AccessedThroughProperty("TxtTongTienBan")]
        private C1NumericEdit _TxtTongTienBan;
        [AccessedThroughProperty("TxtTongTienThue")]
        private C1NumericEdit _TxtTongTienThue;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;

        [DebuggerNonUserCode]
        public Frm_RptDoanhThuTheoMatHangChiTiet()
        {
            base.Load += new EventHandler(this.Frm_RptDoanhThuTheoMatHangChiTiet_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CmdChonHang_Click(object sender, EventArgs e)
        {
            string expression = SearchModule.SearchHangHoa("", "", "");
            if (expression.Trim() != "")
            {
                string[] strArray = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                this.TxtMatHang.Text = strArray[2].ToString().Trim();
                this.TxtMatHang.Tag = strArray[0].ToString().Trim();
            }
        }

        private void CmdExcel_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dialog = new SaveFileDialog {
                    Filter = "Excel Files|*.xls",
                    Title = "Save an Excel file"
                };
                dialog.ShowDialog();
                if (dialog.FileName != "")
                {
                    this.VSlist.SaveExcel(dialog.FileName, "DoanhThuChiTietTheoMatHang", FileFlags.IncludeFixedCells);
                    LVYModule.ShowWarning("Kết xuất ra tập tin Excel th\x00e0nh c\x00f4ng !");
                    Excel.Application application = new ApplicationClass();
                    Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                    application.Visible = true;
                }
            }
            catch (COMException exception1)
            {
                ProjectData.SetProjectError(exception1);
                COMException exception = exception1;
                MessageBox.Show(exception.Message);
                ProjectData.ClearProjectError();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                MessageBox.Show(exception2.Message);
                ProjectData.ClearProjectError();
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            System.Data.DataTable data = this.GetData();
            if (data.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_DoanhThuChiTietTheoMatHang hang = new Rpt_DoanhThuChiTietTheoMatHang();
                try
                {
                    hang.SetDataSource(data);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hang.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    hang.SetParameterValue(5, modGeneral.Tranlated("DOANH THU CHI TIẾT THEO MẶT H\x00c0NG", ""));
                    hang.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " " + this.TxtTuNgay.Text + " đến ng\x00e0y " + this.TxtDenNgay.Text);
                    hang.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    hang.SetParameterValue(0x13, modGeneral.Tranlated("LẬP BIỂU", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message);
                    ProjectData.ClearProjectError();
                }
            }
        }

        private void CmdRefresh_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdThoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_RptDoanhThuTheoMatHangChiTiet_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.TxtMatHang.Tag = "";
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.TxtDenNgay.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
                this.LoadData();
            }
        }

        public System.Data.DataTable GetData()
        {
            string str2 = "";
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtMatHang.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                str2 = " AND HH.Khoa = '" + this.TxtMatHang.Tag.ToString().Trim() + "'";
            }
            string commandText = "SELECT HH.Khoa,XK.SoChungTu, dbo.Char2Date(XK.NgayChungTu)as NgayChungTu,KH.TenViet as TenKhachHang, HH.Ma as MaHang,  HH.TenViet as TenHangHoa,XKCT.SoLuong, XKCT.TienBan - XKCT.TienChietKhau as TienBan, XKCT.TienThue as TienThue  FROM ST_XuatKhoChiTiet XKCT  LEFT JOIN ST_XuatKho XK ON XK.Khoa = XKCT.KhoaPhieuXuat  LEFT JOIN DM_HangHoa HH ON XKCT.KhoaHangHoa = HH.Khoa  LEFT JOIN DM_DoiTuong KH ON XK.KhoaDoiTuong = KH.Khoa  WHERE XK.LoaiChungTu = 'XB' AND XK.GhiSo = 1 AND (XKCT.Loai = 'HB'  OR XKCT.Loai = 'KM') AND XK.NgayChungTu >= '" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' AND XK.NgayChungTu <= '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "'" + str2 + " UNION ALL  SELECT HH.Khoa, NK.SoChungTu, dbo.Char2Date(NK.NgayChungTu) As NgayChungTu, KH.TenViet As TenKhachHang, HH.Ma as MaHang,  HH.Ten" + modGeneral.H_LANGUAGE + "  As TenHangHoa, - NKCT.SoLuong, - NKCT.TienBan, - NKCT.TienThue  FROM ST_NhapKhoChiTiet NKCT  LEFT JOIN ST_NhapKho NK ON NKCT.KhoaPhieuNhap = NK.Khoa  LEFT JOIN DM_HangHoa HH ON NKCT.KhoaHangHoa = HH.Khoa  LEFT JOIN DM_DoiTuong KH ON NK.KhoaDoiTuong = KH.Khoa  WHERE NK.NguonNhap = 'TH' AND NK.NgayChungTu >= '" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' AND NK.NgayChungTu <= '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "'" + str2 + " ORDER BY HH.Khoa ";
            return DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptDoanhThuTheoMatHangChiTiet));
            this.Panel1 = new Panel();
            this.CmdChonHang = new System.Windows.Forms.Button();
            this.TxtMatHang = new System.Windows.Forms.TextBox();
            this.Label2 = new System.Windows.Forms.Label();
            this.CmdRefresh = new System.Windows.Forms.Button();
            this.CmdExcel = new System.Windows.Forms.Button();
            this.CmdPrint = new System.Windows.Forms.Button();
            this.CmdThoat = new System.Windows.Forms.Button();
            this.Label1 = new System.Windows.Forms.Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new System.Windows.Forms.Label();
            this.TxtTuNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel3 = new Panel();
            this.Panel4 = new Panel();
            this.TxtTongTienBan = new C1NumericEdit();
            this.TxtTongTienThue = new C1NumericEdit();
            this.Label23 = new System.Windows.Forms.Label();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.Panel3.SuspendLayout();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtTongTienBan).BeginInit();
            ((ISupportInitialize) this.TxtTongTienThue).BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdChonHang);
            this.Panel1.Controls.Add(this.TxtMatHang);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.CmdRefresh);
            this.Panel1.Controls.Add(this.CmdExcel);
            this.Panel1.Controls.Add(this.CmdPrint);
            this.Panel1.Controls.Add(this.CmdThoat);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x37c, 0x2d);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x13;
            point = new System.Drawing.Point(340, 20);
            this.CmdChonHang.Location = point;
            this.CmdChonHang.Name = "CmdChonHang";
            size = new Size(0x18, 0x17);
            this.CmdChonHang.Size = size;
            this.CmdChonHang.TabIndex = 0x43;
            this.CmdChonHang.Text = "...";
            this.CmdChonHang.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(180, 0x15);
            this.TxtMatHang.Location = point;
            this.TxtMatHang.Name = "TxtMatHang";
            this.TxtMatHang.ReadOnly = true;
            size = new Size(160, 20);
            this.TxtMatHang.Size = size;
            this.TxtMatHang.TabIndex = 0x42;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0xb2, 4);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x34, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x41;
            this.Label2.Text = "Mặt h\x00e0ng";
            this.CmdRefresh.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdRefresh.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x224, 15);
            this.CmdRefresh.Location = point;
            this.CmdRefresh.Name = "CmdRefresh";
            size = new Size(0x53, 0x19);
            this.CmdRefresh.Size = size;
            this.CmdRefresh.TabIndex = 0x40;
            this.CmdRefresh.Text = "&Load";
            this.CmdRefresh.UseVisualStyleBackColor = true;
            this.CmdExcel.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdExcel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x279, 15);
            this.CmdExcel.Location = point;
            this.CmdExcel.Name = "CmdExcel";
            size = new Size(0x53, 0x19);
            this.CmdExcel.Size = size;
            this.CmdExcel.TabIndex = 0x40;
            this.CmdExcel.Text = "&Excel";
            this.CmdExcel.UseVisualStyleBackColor = true;
            this.CmdPrint.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdPrint.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x2cf, 15);
            this.CmdPrint.Location = point;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x53, 0x19);
            this.CmdPrint.Size = size;
            this.CmdPrint.TabIndex = 0x40;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.UseVisualStyleBackColor = true;
            this.CmdThoat.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdThoat.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x324, 15);
            this.CmdThoat.Location = point;
            this.CmdThoat.Name = "CmdThoat";
            size = new Size(0x53, 0x19);
            this.CmdThoat.Size = size;
            this.CmdThoat.TabIndex = 0x40;
            this.CmdThoat.Text = "&Tho\x00e1t";
            this.CmdThoat.UseVisualStyleBackColor = true;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x5c, 5);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(90, 0x15);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new System.Drawing.Point(5, 4);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x3d;
            this.Label13.Text = "Từ ng\x00e0y";
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(3, 0x15);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new System.Drawing.Point(0, 0x2d);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x37c, 0x209);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x17;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel3.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel3.BackgroundImageLayout = ImageLayout.Stretch;
            this.Panel3.Controls.Add(this.Panel4);
            this.Panel3.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x217);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x37c, 0x1f);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0x4a;
            this.Panel4.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel4.BackgroundImageLayout = ImageLayout.Stretch;
            this.Panel4.Controls.Add(this.TxtTongTienBan);
            this.Panel4.Controls.Add(this.TxtTongTienThue);
            this.Panel4.Controls.Add(this.Label23);
            this.Panel4.Dock = DockStyle.Right;
            point = new System.Drawing.Point(490, 0);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x192, 0x1f);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 1;
            this.TxtTongTienBan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongTienBan.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.5f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.TxtTongTienBan.FormatType = FormatTypeEnum.StandardNumber;
            point = new System.Drawing.Point(0x73, 6);
            this.TxtTongTienBan.Location = point;
            this.TxtTongTienBan.Name = "TxtTongTienBan";
            Padding padding = new Padding(1);
            this.TxtTongTienBan.Padding = padding;
            this.TxtTongTienBan.ReadOnly = true;
            size = new Size(0x8b, 20);
            this.TxtTongTienBan.Size = size;
            this.TxtTongTienBan.TabIndex = 0x8b;
            this.TxtTongTienBan.Tag = null;
            this.TxtTongTienBan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongTienBan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongTienBan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienBan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongTienThue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.5f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.TxtTongTienThue.FormatType = FormatTypeEnum.StandardNumber;
            point = new System.Drawing.Point(260, 6);
            this.TxtTongTienThue.Location = point;
            this.TxtTongTienThue.Name = "TxtTongTienThue";
            padding = new Padding(1);
            this.TxtTongTienThue.Padding = padding;
            this.TxtTongTienThue.ReadOnly = true;
            size = new Size(0x8b, 20);
            this.TxtTongTienThue.Size = size;
            this.TxtTongTienThue.TabIndex = 0x8b;
            this.TxtTongTienThue.Tag = null;
            this.TxtTongTienThue.TextAlign = HorizontalAlignment.Right;
            this.TxtTongTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongTienThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label23.AutoSize = true;
            this.Label23.BackColor = Color.Transparent;
            this.Label23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new System.Drawing.Point(0x1f, 9);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x44, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x8a;
            this.Label23.Text = "Tổng cộng";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37c, 0x236);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.Panel3);
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptDoanhThuTheoMatHangChiTiet";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-BH14";
            this.Text = "DOANH THU THEO MAT HANG CHI TIET";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.Panel3.ResumeLayout(false);
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtTongTienBan).EndInit();
            ((ISupportInitialize) this.TxtTongTienThue).EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            double left = 0.0;
            double num2 = 0.0;
            System.Data.DataTable data = this.GetData();
            if (data != null)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                this.VSlist.Rows.Count = 1;
                int num4 = data.Rows.Count - 1;
                for (int i = 0; i <= num4; i++)
                {
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = data.Rows[i]["Khoa"].ToString().Trim();
                    vSlist[vSlist.Rows.Count - 1, 1] = data.Rows[i]["MaHang"].ToString().Trim();
                    vSlist[vSlist.Rows.Count - 1, 2] = data.Rows[i]["TenHangHoa"].ToString().Trim();
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TenKhachHang"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(data.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TienBan"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TienThue"]);
                    left = Conversions.ToDouble(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(left, data.Rows[i]["TienBan"]));
                    num2 = Conversions.ToDouble(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(num2, data.Rows[i]["TienThue"]));
                }
                vSlist.Tree.Column = 3;
                vSlist.Subtotal(AggregateEnum.Sum, 0, 2, 2, 6, "{0}");
                vSlist.Subtotal(AggregateEnum.Sum, 0, 2, 2, 7, "{0}");
                vSlist.Subtotal(AggregateEnum.Sum, 0, 2, 2, 8, "{0}");
                vSlist.Cols[3].Width = 300;
                vSlist.Cols[4].Width = 120;
                vSlist.Cols[5].Width = 120;
                vSlist.Cols[6].Width = 110;
                vSlist.Cols[7].Width = 110;
                vSlist.Cols[8].Width = 110;
                vSlist.Cols[6].DataType = System.Type.GetType("System.Decimal");
                vSlist.Cols[7].DataType = System.Type.GetType("System.Decimal");
                vSlist.Cols[8].DataType = System.Type.GetType("System.Decimal");
                vSlist.Cols[6].Format = modGeneral.H_FORMATNUMBER;
                vSlist.Cols[7].Format = modGeneral.H_FORMATNUMBER;
                vSlist.Cols[8].Format = modGeneral.H_FORMATNUMBER;
                vSlist.Cols[1].Visible = false;
                vSlist.Cols[2].Visible = false;
                vSlist = null;
                this.TxtTongTienBan.Value = left;
                this.TxtTongTienThue.Value = num2;
            }
        }

        internal virtual System.Windows.Forms.Button CmdChonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdChonHang_Click);
                if (this._CmdChonHang != null)
                {
                    this._CmdChonHang.Click -= handler;
                }
                this._CmdChonHang = value;
                if (this._CmdChonHang != null)
                {
                    this._CmdChonHang.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExcel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExcel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExcel_Click);
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click -= handler;
                }
                this._CmdExcel = value;
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdRefresh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdRefresh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdRefresh_Click);
                if (this._CmdRefresh != null)
                {
                    this._CmdRefresh.Click -= handler;
                }
                this._CmdRefresh = value;
                if (this._CmdRefresh != null)
                {
                    this._CmdRefresh.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdThoat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdThoat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdThoat_Click);
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click -= handler;
                }
                this._CmdThoat = value;
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual System.Windows.Forms.TextBox TxtMatHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMatHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMatHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTongTienBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongTienBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongTienBan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongTienThue = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

